package com.zbkj.service.service.order.impl;

import com.zbkj.dal.token.FrontTokenComponent;
import com.zbkj.service.manager.OrderManager;
import com.zbkj.service.model.dto.OrderPreCheckDTO;
import com.zbkj.service.model.front.req.order.OrderPreCheckReq;
import com.zbkj.service.service.order.OrderV2Service;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OrderV2ServiceImpl implements OrderV2Service {

    @Resource
    private OrderManager orderManager;

    @Resource
    private FrontTokenComponent frontTokenComponent;

    @Override
    public OrderPreCheckDTO orderPreCheck(OrderPreCheckReq req) {
        Integer userId = frontTokenComponent.userId();
        return orderManager.orderPreCheck(userId, req.getProductId());
    }

}
